package com.lhys.mapper;

import com.lhys.pojo.AssetDepart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 资产_部门表 Mapper 接口
 * </p>
 *
 * @author 小七
 * @since 2021-05-06
 */
public interface AssetDepartMapper {
    @Insert("INSERT INTO asset_depart(asset_user_id, title, code,status,remark,create_time) VALUES (#{assetUserId}, #{title}, #{code}, #{status}, #{remark}, #{createTime})")
    Integer addAssetDepart(AssetDepart AssetDepart);

    @Delete("delete from asset_depart where id = #{id}")
    Integer delAssetDepart(Integer id);

    Integer updateAssetDepart(AssetDepart assetDepart);

    @Select("select * from asset_depart where id = #{id}")
    AssetDepart getAssetDepartById(Integer id);

    @Select("select * from asset_depart where asset_user_id = #{id}")
    AssetDepart getAssetDepartByUserId(Integer id);

    @Select("select * from asset_depart where code = #{code}")
    AssetDepart getAssetDepartByCode(String code);

    List<AssetDepart> getAssetDepartByCodeAndTitleOrRemarkList(AssetDepart assetDepart);

    @Select("select * from asset_depart where title = #{title}")
    AssetDepart getAssetDepartByTitle(String title);
}
